<?php

namespace app\admin\model;

use think\model\Relation;

class Travelv extends Relation {

      public function setStatis($name, $value) {
                $id = $this->where(array('name' => $name))->getField('id');
                if (is_array($value))
                        $value = serialize($value);
                if ($id) {
                        $this->where(array('id' => $id))->setField("value", $value);
                } else {
                        $this->add(array(
                            'name' => $name,
                            'value' => $value,
                        ));
                }
        }


}
